<template>
	<!-- 选择银行卡组件 -->
	<view class="selectbank">
		<unipopup :show="showtip" type="bottom" :mask-click="true" @change="change">
			<view class="selectbank_main">
				<view class="selectheads flex ali-c jus-b">
					<navigator class="addcardbtn" url="/pages/mine/bind_bank/bind_bank" hover-class="none">添加银行卡</navigator>
					<image @tap="hide" class="clonebtn" :src="photo_cdn1 + 'zpupload/static/img/clonebtn.png'" mode=""></image>
				</view>
				
				<view class="banklistdata" v-if="bankcards.length!=0">
					<view class="bank_item"  v-for="(item,index) in bankcards" :key="index" @tap="selectcard(item)">
						<image class="bankitembg" :src="photo_cdn1+'/zpupload/20230727/bb3943d64c41b29bdd.png'" mode=""></image>
						<view class="card_info">
							<view class="num">
								<view class="card_num">{{item.bank_name}}</view>
								<view class="time">{{item.bank_num}}</view>
							</view>
						</view>
						<!-- <view class="disbind" @tap="delBankfun(item)" >解除绑定</view> -->
					</view>
				</view>
				
				
			</view>
		</unipopup>
	</view>
</template>

<script>
	import unipopup from '@/components/uni-popup/uni-popup.vue'
	import config from "@/utils/config.js";
	let {staticurl,photo_cdn1} = config.baseUrl;
	export default {
		props:{
			bankcards:{
				type:Array,
				default:()=>{
					return [];
				},
			}
		},
		components:{
			unipopup,
		},
		data(){
			return {
				photo_cdn1,
				staticurl,
				showtip:false,
			}
		},
		methods:{
			show(){
				console.info("show fun");
				this.showtip = true;
			},
			hide(){
				this.showtip = false;
			},
			//提示弹窗
			change(e) {
				if (!e.show) {
					this.showtip = false
				}
			},
			//选择银行卡
			selectcard(itemdata){
				this.showtip = false;
				this.$emit("select",{data:itemdata})
			}
		}
	}
</script>

<style lang="scss">
	@import "./selectbank.scss";
</style>